const Index = require('./home');
const path = require('path');

module.exports = class extends Index {
  async __before() {
    this.ext = await this.model('ext').where({
      ext: this.ctx.controller.split('/')[1]
    }).find();
    this.meta_title = this.ext.name;
    if (!think.isEmpty(this.ext.setting)) {
      this.setting = JSON.parse(this.ext.setting);
    } else {
      this.setting = {};
    }
  }
};
